package com.qianli.cashmama.trade.common.mq;

/**
 * mq事件枚举
 * Author: Karl
 * Date: 2020/10/19 下午3:14
 */
public enum MQTradeActionEnum {

    INIT("INFORMATION TO BE ADDED", ""),
    AUDIT("AUDITING", ""),
    AUDIT_PASS("AUDIT_PASS", ""),
    AUDIT_REJECT("AUDIT_REJECT", ""),

    DISBURSE_SUCCESS("DISBURSE_SUCCESS", ""),
    DISBURSE_FAIL("DISBURSE_FAIL", ""),
    DISBURSE_FAIL_REBIND("DISBURSE_FAIL_REBIND", ""),

    OVERDUE("OVERDUE", ""),
    REPAY_SUCCESS("REPAY_SUCCESS", ""),
    ;

    private String code;
    private String desc;

    MQTradeActionEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public MQTradeActionEnum setCode(String code) {
        this.code = code;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public MQTradeActionEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static MQTradeActionEnum getEnum(String code) {
        for (MQTradeActionEnum e : MQTradeActionEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }

}
